# -*- coding: utf-8 -*-
from common import orm
from common.utils.types import Enum

RECORD_STATUS = Enum({
    "UNMATCH": (0L, u"未匹配"),
    "MATCHED": (1L, u"已匹配"),
})

RECORD_TYPE = Enum({
    "DEPOSIT": (0L, u"Collection"),
    "WITHDRAWAL": (1L, u"Payment"),
})


class BankRecord(orm.Model):
    """
    银行卡记录
    """
    __tablename__ = "bank_record"
    id = orm.Column(orm.Integer, primary_key=True, autoincrement=True)
    bankcard_name = orm.Column(orm.VARCHAR)
    mch_id = orm.Column(orm.Integer)
    order_id = orm.Column(orm.Integer)
    detail = orm.Column(orm.VARCHAR)
    bankcard_num = orm.Column(orm.VARCHAR)
    bank = orm.Column(orm.VARCHAR)
    payer = orm.Column(orm.VARCHAR)
    transfer_from = orm.Column(orm.VARCHAR)
    transfer_to = orm.Column(orm.VARCHAR)
    trading_channel = orm.Column(orm.VARCHAR)
    amount = orm.Column(orm.FLOAT)
    balance = orm.Column(orm.FLOAT)
    remarks = orm.Column(orm.VARCHAR)
    notes = orm.Column(orm.VARCHAR)
    transaction_time = orm.Column(orm.DATETIME)
    status = orm.Column(orm.Integer, default=0)
    type= orm.Column(orm.Integer, default=0)
    created_at = orm.Column(orm.DATETIME)
    updated_at = orm.Column(orm.DATETIME)
